angular.module('jie', ['ionic'])

    .controller('EditController', function ($scope, $http) {

        $scope.save = function () {
            let data = {
                "contentTitle" : $scope.content,
                "contentText" : $scope.title
            };

            $http.post('/jie/save', data).then(
                function success(response) {
                    if(response.data.code == 0){
                        alert("成功");
                    }else{
                        alert(response.data.msg);
                    }
                },
                function error() {
                    alert("请求失败");
                }
            );
        };
    });